<?php
/**
 * Parcl
 *
 * LICENSE
 *
 * This source file is subject to the new BSD license that is bundled
 * with this package in the file LICENSE.txt.
 * It is also available through the world-wide-web at this URL:
 * http://parcl.com/license
 * If you did not receive a copy of the license and are unable to
 * obtain it through the world-wide-web, please send an email
 * to license@parcl.com so we can send you a copy immediately.
 *
 * @category parcl
 * @package parcl-core
 * @copyright Copyright (c) 2006-2011 Mikael Knutsson (http://mikn.me)
 * @license http://parcl.com/license New BSD License
 */

if(PARCL_EXEC !== 1) {
    die('<h1>Incorrect Access</h1>You cannot access this file directly.<br/>' .
         'If you got this error message by clicking a link on the site,' .
         'please notify the webmaster as soon as possible.');
}



/***
 * This is the general-purpose Exception class. Not sure of how to integrate
 * the check of the constant PARCL_EXEC into every file of parcl without having
 * to define too much. At least not if I'm using the Exception system.
 *
 * NOTICE messages, ie. Exceptions that are not supposed to stop execution will
 * carry 80 infront of the number corresponding to the fatal error they represent.
 * This means that the number 80 is to be excluded from all other error code.
 */

class GeneralException extends Exception {
    const UNAUTHACC = 1;
    const CLONING = 2;
    const NOSUPPORT = 3;
    const ORPHAN = 4;
    const VAR_TYPE = 5;
    const XML = 6;
    const XSL = 7;
    const REGISTRY = 8;
    const ROW_COUNT = 9;
    const MODULES = 10;
    const FILE_NOT_FOUND = 11;
	const VAR_TYPE_NOTICE = 805;
    const REGISTRY_NOTICE = 808;
}

class ContentException extends Exception {
    const PAGE_NOT_FOUND = 404;
}

class EventException extends Exception {
    const CALLBACK = 1;
    const HANDLER = 2;
    const EVENT = 3;
    const NS = 4;
    const EVENT_NOTICE = 803;
    const NS_NOTICE = 804;
}

class DBException extends Exception {
    const CONNECTION = 1;
    const QUERY = 2;
    const PARAM = 3;
    const QUERY_NOTICE = 802;
}